ComponentOne ADO.NET DataExtender
C1.C1DataExtender.2 Assembly / C1.C1DataExtender Namespace / C1DataView Class / FindByPrimaryKey Method / FindByPrimaryKey(Object[]) Method
An array of primary key values. The length and order of values of the array must be the same as in the PrimaryKey property. If the System.Type of some array value differs from the C1ViewColumn.DataType of the corresponding primary key column then this value will be converted to the column's target type automatically. In the case where such a conversion is impossible, an exception will be raised.

In This Topic
    FindByPrimaryKey(Object[]) Method
    In This Topic
    Finds a row in this C1DataView by the specified primary key value.
    Syntax
    'Declaration
     
    Public Overloads Function FindByPrimaryKey( _
       ByVal key() As System.Object _
    ) As System.Integer
    public System.int FindByPrimaryKey( 
       System.object[] key
    )

    Parameters

    key
    An array of primary key values. The length and order of values of the array must be the same as in the PrimaryKey property. If the System.Type of some array value differs from the C1ViewColumn.DataType of the corresponding primary key column then this value will be converted to the column's target type automatically. In the case where such a conversion is impossible, an exception will be raised.

    Return Value

    An index of found row or -1 if row has not been found.
    See Also